<html>
<head>
	<meta name="layout" content="mainLayout" />
	<g:set var="entityName" value="${message(code: 'shirt.label', default: 'Shirt')}" />
</head>
<body>
  
  
  
  <h1>Shopping Cart</h1>
    <div class="list">
      <table>
        <thead>
          <tr>

            <th>Product</th>

            <th>Qty</th>

            <th>&nbsp;</th>

            <th>&nbsp;</th>

            <th>&nbsp;</th>

          </tr>
        </thead>
        <tbody id="shoppingCartContent">
        <g:render plugin="shoppingCart" template="../testShoppingCart/shoppingCartContent"/>
        </tbody>
      </table>
      <br />
      <g:remoteLink action="checkOut"
                    update="shoppingCartContent"
                    onComplete="Effect.Pulsate('shoppingCartContent', {pulses: 1, duration: 1.0});">
					Check out
      </g:remoteLink>
    </div>
  
  
  
	<div id="col_middle">
		<h1>
			<g:message code="default.list.label" args="[entityName]" />
		</h1>
		 <div class="list">
                <table>
                    <thead>
                        <tr>
                         <th><g:message code="shirt.id.label" default="Id" /></th>
                            
                         <th><g:message code="shirt.shirtID.label" default="Shirt ID" /></th>
                         
                           <th><g:message code="shirt.shirtName.label" default="Shirt Name" /></th>
                           
                         <th><g:message code="shirt.shirtName.label" default="Design Name" /></th>
                         
                         <th><g:message code="shirt.collar.label" default="Collar" /></th>
                        
                         <th><g:message code="shirt.cuff.label" default="Cuff" /></th>
                         
                         <th><g:message code="shirt.designName.label" default="Design Picture" /></th>
                            
                        
                        </tr>
                    </thead>
                    <tbody>
                    
                    <g:each in="${regionList}" status="j" var="regionInstance">
                    <tr><td colspan="7"><h1>Region:&nbsp;${fieldValue(bean: regionInstance.tailor.regions, field: "regionName")}</h1></td>
                                     
                    </tr>
                    
                    <g:each in="${shirtList}" status="i" var="shirtInstance">
                    <g:if test="${fieldValue(bean: regionInstance.tailor.regions, field: 'regionID')==fieldValue(bean: shirtInstance.tailor.regions, field: 'regionID')}" >
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${shirtInstance.id}">${fieldValue(bean: shirtInstance, field: "id")}</g:link></td>
                        
                            <td>${fieldValue(bean: shirtInstance, field: "shirtID")}</td>
                        
                        	<td>${fieldValue(bean: shirtInstance, field: "shirtName")}</td>
                        	
                            <td>${fieldValue(bean: shirtInstance, field: "designName")}</td>
                        
                            <td>${fieldValue(bean: shirtInstance.collar, field: "collarName")}</td>
                        
                            <td>${fieldValue(bean: shirtInstance.cuff, field: "cuffName")}</td>
                        
                            <td><g:remoteLink action="add"
                              params="${[id:shirtInstance.shirtID, class:shirtInstance.class, version:shirtInstance.version]}"
                     
                            update="shoppingCartContent"
                            onComplete="Effect.Pulsate('shoppingCartContent', {pulses: 1, duration: 1.0});">
										Add to Cart
                              </g:remoteLink>
                            </td>
                            
                        </tr>
                     </g:if>
                    </g:each>
                     </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${shirtInstanceTotal}" />
            </div>
	</div>
</body>
</html>